import myRequest from '..'

//获取用户信息
export const getUserInfo = async () => {
  return myRequest.get({
    url: '/user/info',
  })
}

//注册
export const register = async (username: string, password: string, nickname?: string) => {
  return myRequest.post({
    url: '/user/register',
    data: { username, password, nickname: nickname || username },
  })
}

//登录
export const login = async (username: string, password: string) => {
  return myRequest.post({
    url: '/user/login',
    data: { username, password },
  })
}
